<?php

/**
 * LigneReglementFournisseur form base class.
 *
 * @method LigneReglementFournisseur getObject() Returns the current form's model object
 *
 * @package    SdCommerce
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseLigneReglementFournisseurForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                     => new sfWidgetFormInputHidden(),
      'numero_piece'           => new sfWidgetFormInputText(),
      'numero_piece_du_cheque' => new sfWidgetFormInputText(),
      'montant'                => new sfWidgetFormInputText(),
      'date'                   => new sfWidgetFormDate(),
      'date_prise_en_charge'   => new sfWidgetFormDate(),
      'date_echeance'          => new sfWidgetFormDate(),
      'verser'                 => new sfWidgetFormInputCheckbox(),
      'valide'                 => new sfWidgetFormInputCheckbox(),
      'etat'                   => new sfWidgetFormInputCheckbox(),
      'reglement_id'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ReglementFournisseur'), 'add_empty' => true)),
      'id_mode_reglement'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ModeReglement'), 'add_empty' => true)),
      'id_organisme'           => new sfWidgetFormInputText(),
      'id_caisse'              => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Caisse'), 'add_empty' => true)),
      'id_compte_bancaire'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('CompteBancaire'), 'add_empty' => true)),
      'id_retenue_source'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('RetenueSource'), 'add_empty' => true)),
      'journal_caisse'         => new sfWidgetFormInputCheckbox(),
      'facture_id'             => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('FactureFournisseur'), 'add_empty' => true)),
      'bon_livraison_id'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('BonLivraisonFournisseur'), 'add_empty' => true)),
      'facture_avoir_id'       => new sfWidgetFormInputText(),
      'bl_retour_id'           => new sfWidgetFormInputText(),
      'created_at'             => new sfWidgetFormDateTime(),
      'updated_at'             => new sfWidgetFormDateTime(),
      'deleted_at'             => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                     => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'numero_piece'           => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'numero_piece_du_cheque' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'montant'                => new sfValidatorNumber(array('required' => false)),
      'date'                   => new sfValidatorDate(),
      'date_prise_en_charge'   => new sfValidatorDate(array('required' => false)),
      'date_echeance'          => new sfValidatorDate(array('required' => false)),
      'verser'                 => new sfValidatorBoolean(),
      'valide'                 => new sfValidatorBoolean(),
      'etat'                   => new sfValidatorBoolean(),
      'reglement_id'           => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('ReglementFournisseur'), 'required' => false)),
      'id_mode_reglement'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('ModeReglement'), 'required' => false)),
      'id_organisme'           => new sfValidatorInteger(array('required' => false)),
      'id_caisse'              => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Caisse'), 'required' => false)),
      'id_compte_bancaire'     => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('CompteBancaire'), 'required' => false)),
      'id_retenue_source'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('RetenueSource'), 'required' => false)),
      'journal_caisse'         => new sfValidatorBoolean(array('required' => false)),
      'facture_id'             => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('FactureFournisseur'), 'required' => false)),
      'bon_livraison_id'       => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('BonLivraisonFournisseur'), 'required' => false)),
      'facture_avoir_id'       => new sfValidatorInteger(array('required' => false)),
      'bl_retour_id'           => new sfValidatorInteger(array('required' => false)),
      'created_at'             => new sfValidatorDateTime(),
      'updated_at'             => new sfValidatorDateTime(),
      'deleted_at'             => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('ligne_reglement_fournisseur[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'LigneReglementFournisseur';
  }

}
